import { Camera3D } from 'feng3d-three';
import { FirstPersonControls } from '../thirdparty/three/imports';

export class FirstPersonControls3D
{
    _controls: FirstPersonControls;

    constructor(object: Camera3D, domElement?: HTMLElement)
    {
        this._controls = new FirstPersonControls(object.entity as any, domElement);
    }

    get movementSpeed()
    {
        return this._controls.movementSpeed;
    }
    set movementSpeed(v)
    {
        this._controls.movementSpeed = v;
    }

    get lookSpeed()
    {
        return this._controls.lookSpeed;
    }
    set lookSpeed(v)
    {
        this._controls.lookSpeed = v;
    }

    get lookVertical()
    {
        return this._controls.lookVertical;
    }
    set lookVertical(v)
    {
        this._controls.lookVertical = v;
    }

    update(delta: number)
    {
        this._controls.update(delta);

        return this;
    }

    handleResize()
    {
        this._controls.handleResize();
    }
}
